<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>店铺榜单</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/font-awesome.min93e3.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/style.min.css"/>
<style type="text/css">
body{font-size: 14px;padding: 20px 0px 0;}
table tr{border-bottom: 1px solid #eee;height: 50px;}
table tr:nth-child(1){font-size: 16px;color: #ed5565;font-weight: bold;}
table tr:nth-child(2){font-size: 16px;color: #a765f1;font-weight: bold;}
table tr:nth-child(3){font-size: 16px;color: #f8ac59;font-weight: bold;}
table tr>td:nth-child(1){width: 44px;}
</style>
</head>
<body class="gray-bg">
<div class="container-fluid">
	<div class="row">
		<div class="col-sm-3">
			<div class="ibox">
	            <div class="ibox-title">发起活动量</div>
	            <div class="ibox-content">
	            	<table id="activityCountTop10" style="width: 100%;">
	            		<tr>
	            			<td>1</td>
	            			<td>广渠门店</td>
	            			<td>45</td>
	            		</tr>
	            		<tr>
	            			<td>2</td>
	            			<td>双井店</td>
	            			<td>43</td>
	            		</tr>
	            		<tr>
	            			<td>2</td>
	            			<td>双井店</td>
	            			<td>43</td>
	            		</tr>
	            		<tr>
	            			<td>2</td>
	            			<td>双井店</td>
	            			<td>43</td>
	            		</tr>
	            	</table>
	            </div>
	        </div>
		</div>
		<div class="col-sm-3">
			<div class="ibox">
	            <div class="ibox-title">参与活动人数</div>
	            <div class="ibox-content">
	            	<table id="peopleCountTop10" style="width: 100%;">
	            	</table>
	            </div>
	        </div>
		</div>
		<div class="col-sm-3">
			<div class="ibox">
	            <div class="ibox-title">会员增长量</div>
	            <div class="ibox-content">
	            	<table id="growCountTop10" style="width: 100%;">
	            	暂无数据
	            	</table>
	            </div>
	        </div>
		</div>
		<div class="col-sm-3">
			<div class="ibox">
	            <div class="ibox-title">交易额</div>
	            <div class="ibox-content">
	            	<table id="costTotalTop10" style="width: 100%;">
	            	</table>
	            </div>
	        </div>
		</div>
	</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
var path = "<%=path%>";

$(function(){
	init();
});

function init(){
	func_activityCountTop10();
	func_peopleCountTop10();
	func_growCountTop10();
	func_costTotalTop10();
}

function func_activityCountTop10(){
	$.post(path+"/scan/analyze/activityCountTop10",function(data){
		if(data.msg_code == 1){
			var tr = "";
			$.each(data.data,function(i,d){
				var img = "";
				if(i == 0){
					img = '<img src="'+path+'/images/箭头-第一名.png">';
				}else if(i == 1){
					img = '<img src="'+path+'/images/箭头-第二名.png">';
				}else if(i == 2){
					img = '<img src="'+path+'/images/箭头-第三名.png">';
				}
				tr += '<tr>';
				tr += '<td>'+(i+1)+'</td>';
				tr += '<td>'+d.storeName+img+'</td>';
				tr += '<td>'+d.count+'</td>';
				tr += '</tr>';
			});
			if(tr != ""){
				$("#activityCountTop10").html(tr);
			}else{
				$("#activityCountTop10").html("暂无数据");
			}
		}
	},"json");
}
function func_peopleCountTop10(){
	$.post(path+"/scan/analyze/peopleCountTop10",function(data){
		if(data.msg_code == 1){
			var tr = "";
			$.each(data.data,function(i,d){
				var img = "";
				if(i == 0){
					img = '<img src="'+path+'/images/箭头-第一名.png">';
				}else if(i == 1){
					img = '<img src="'+path+'/images/箭头-第二名.png">';
				}else if(i == 2){
					img = '<img src="'+path+'/images/箭头-第三名.png">';
				}
				tr += '<tr>';
				tr += '<td>'+(i+1)+'</td>';
				tr += '<td>'+d.storeName+img+'</td>';
				tr += '<td>'+d.count+'</td>';
				tr += '</tr>';
			});
			if(tr != ""){
				$("#peopleCountTop10").html(tr);
			}else{
				$("#peopleCountTop10").html("暂无数据");
			}
		}
	},"json");
}
function func_growCountTop10(){
	$.post(path+"/scan/analyze/growCountTop10",function(data){
		if(data.msg_code == 1){
			var tr = "";
			$.each(data.data,function(i,d){
				var img = "";
				if(i == 0){
					img = '<img src="'+path+'/images/箭头-第一名.png">';
				}else if(i == 1){
					img = '<img src="'+path+'/images/箭头-第二名.png">';
				}else if(i == 2){
					img = '<img src="'+path+'/images/箭头-第三名.png">';
				}
				tr += '<tr>';
				tr += '<td>'+(i+1)+'</td>';
				tr += '<td>'+d.storeName+img+'</td>';
				tr += '<td>'+d.count+'</td>';
				tr += '</tr>';
			});
			if(tr != ""){
				$("#growCountTop10").html(tr);
			}else{
				$("#growCountTop10").html("暂无数据");
			}
		}
	},"json");
}
function func_costTotalTop10(){
	$.post(path+"/scan/analyze/costTotalTop10",function(data){
		if(data.msg_code == 1){
			var tr = "";
			$.each(data.data,function(i,d){
				var img = "";
				if(i == 0){
					img = '<img src="'+path+'/images/箭头-第一名.png">';
				}else if(i == 1){
					img = '<img src="'+path+'/images/箭头-第二名.png">';
				}else if(i == 2){
					img = '<img src="'+path+'/images/箭头-第三名.png">';
				}
				tr += '<tr>';
				tr += '<td>'+(i+1)+'</td>';
				tr += '<td>'+d.storeName+img+'</td>';
				tr += '<td>'+d.count+'</td>';
				tr += '</tr>';
			});
			if(tr != ""){
				$("#costTotalTop10").html(tr);
			}else{
				$("#costTotalTop10").html("暂无数据");
			}
		}
	},"json");
}
</script>
</html>